# Maintainer: David Runge <dvzrv@archlinux.org>

_name=selinux
pkgname=python-selinux
pkgver=0.3.0
pkgrel=2
pkgdesc="Pure-python selinux shim module for use in virtualenvs"
arch=(any)
url="https://github.com/pycontribs/selinux"
license=(MIT)
depends=(python-distro)
makedepends=(python-build python-installer python-setuptools python-setuptools-scm python-wheel)
source=(https://files.pythonhosted.org/packages/source/${_name::1}/$_name/$_name-$pkgver.tar.gz)
sha512sums=('4af1649868f180a4549cfbdbf380a85100fa7e99b815b94d9069fbf05f7ca5377fc6acfed526621c1b4c6a781fd13df864ab194b14314ba4d4375f5b6230800e')
b2sums=('f46b26e4af2ad33cdb3fa54e1d0033aba8f00db0ce6845b3440a86430107456e7a55b67da5fad56bcc85c8b3efe18439e510ca1dcdb8cc473966c597534b944e')

build() {
  cd $_name-$pkgver
  export SETUPTOOLS_SCM_PRETEND_VERSION="$pkgver"
  python -m build --wheel --no-isolation
}

package() {
  cd $_name-$pkgver
  python -m installer --destdir="$pkgdir" dist/*.whl
  install -vDm 644 LICENSE -t "$pkgdir/usr/share/licenses/$pkgname/"
  install -vDm 644 README.rst -t "$pkgdir/usr/share/doc/$pkgname/"
}
